package com.orm.executor;


import com.orm.mapping.MapperStatement;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

/**
 * 执行器改写为接口，方便后面 和 ioc 容器整合时，继承或者实现这个类就行
 */

public interface Executor {
	
	Connection getConnection() throws SQLException;
	
	void close(Connection conn, PreparedStatement ps, ResultSet rs);
	
	
	int selectCount(MapperStatement mapperStatement,Object[] args);
	
	Object selectOne(MapperStatement mapperStatement,Object[] args);
	
	List<Object> selectList(MapperStatement mapperStatement, Object[] args);
	
	// 插入返回的是主键
	int insert(MapperStatement mapperStatement, Object[] args);
	
	// 修改删除返回影响行数
	int update(MapperStatement mapperStatement, Object[] args);
	
}
